package xcmg.device.dao.mapper.delivery;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.delivery.DeliveryReceiptLinkDO;
import xcmg.device.dao.entity.warehouse.WarehouseDeliveryDetailDO;
import xcmg.device.service.vo.delivery.DeliveryReceiptLinkDetailVO;
import xcmg.device.service.vo.delivery.DeliveryStatusVO;

import java.util.List;

@Mapper
public interface DeliveryReceiptLinkMapper {
    int insert(DeliveryReceiptLinkDO record);

    int deleteByDeliveryReceiptId(String deliveryBillId);

    int deleteItem(@Param("deliveryBillId")String deliveryBillId,@Param("deliveryNoteId")String deliveryNoteId);

    List<DeliveryReceiptLinkDO> list(@Param("deliveryBillId")String deliveryBillId);

    List<DeliveryReceiptLinkDO> listByDeliveryBillNo(@Param("deliveryBillNo")String deliveryBillNo);

    List<DeliveryReceiptLinkDO> selectByDeliveryNoteId(@Param("deliveryNoteId") String deliveryNotId);

    List<DeliveryReceiptLinkDO> selectByDeliveryNoteIdNoDel(@Param("deliveryNoteId") String deliveryNotId);

    List<WarehouseDeliveryDetailDO> listForDeliveryNote(@Param("deliveryBillNo")String deliveryBillNo);

    List<WarehouseDeliveryDetailDO> listForThreeOut(@Param("deliveryBillNo")String deliveryBillNo);

    List<WarehouseDeliveryDetailDO> listForRegionAllot(@Param("deliveryBillNo")String deliveryBillNo);

    List<WarehouseDeliveryDetailDO> listForAbnormalOut(@Param("deliveryBillNo")String deliveryBillNo);

    List<WarehouseDeliveryDetailDO> listForSalesOut(@Param("deliveryBillNo")String deliveryBillNo);

    List<WarehouseDeliveryDetailDO> findLocationAnKeepName(DeliveryReceiptLinkDetailVO condition);

    String findInventoryLocation(DeliveryReceiptLinkDetailVO condition);

    List<String> findReceiptIds(@Param("deliveryNoteId")String deliveryNoteId);

    String getPurchaseNoByBusinessId(@Param("deliveryReceiptNo")String deliveryReceiptNo, @Param("businessId")String businessId);

    List<DeliveryStatusVO> listStatusByPurchaseNo(@Param("purchaseNo") String purchaseNo);

    List<DeliveryReceiptLinkDO> findByDeliveryNoteNo(@Param("deliveryBillNo") String deliveryBillNo);

    List<String> findByDeliveryBillNo(@Param("deliveryBillNo")String deliveryBillNo);

    List<String> existedDeliveryReceipt(@Param("deliveryNoteNos") List<String> deliveryNoteNos,@Param("orgId") String orgId);

    List<DeliveryReceiptLinkDO> listAll(@Param("billIds") List<String> billIds);
    
    List<DeliveryReceiptLinkDO> findDeliveryNoteIds(@Param("deliveryNoteId")String deliveryNoteId );

}